﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace MethodSeqGenerator
{
    class GraphViewer
    {
        public static void Main()
        {
            //create a form
            System.Windows.Forms.Form form = new System.Windows.Forms.Form();
            //create a viewer object
            Microsoft.Msagl.GraphViewerGdi.GViewer viewer = new Microsoft.Msagl.GraphViewerGdi.GViewer();

            //create a graph object
            Microsoft.Msagl.Drawing.Graph graph = new Microsoft.Msagl.Drawing.Graph("graph");
            //create the graph content
            graph.AddEdge("A", "B");
            graph.AddEdge("B", "C");
            /*graph.AddEdge("A", "C").EdgeAttr.Color =
                    Microsoft.Msagl.Drawing.Color.Green;*/
            graph.FindNode("A").Attr.Color = Microsoft.Msagl.Drawing.Color.Magenta;
            //graph.FindNode("B").Attr.Color = Microsoft.Msagl.Drawing.Color.MistyRose;
            //Microsoft.Msagl.Drawing.Node c = graph.FindNode("C");
            
            //c.Attr.Fillcolor = Microsoft.Msagl.Drawing.Color.PaleGreen;
            //c.Attr.Shape = Microsoft.Msagl.Drawing.Shape.Diamond;
            //bind the graph to the viewer
            viewer.Graph = graph;

            //associate the viewer with the form
            form.SuspendLayout();
            viewer.Dock = System.Windows.Forms.DockStyle.Fill;
            form.Controls.Add(viewer);
            form.ResumeLayout();

            //show the form
            form.ShowDialog();
        }

    }
}
